import pytest

from api.login import loginapi
from common.common_assert import asset
class Test_login():

    # 用框架批量实现
    @pytest.mark.parametrize("body,status_code,message,code,success",
                         [({"mobile": "13800000002", "password": "123456"},200,"操作成功！",10000,True),
                         ({"mobile": "13800000002", "password": "1234567"},200,"用户名或密码错误",20001,False),
                         ({"mobile": "13888881111", "password": "123456"},200,"用户名或密码错误",20001,False)])
    def test_login_success(self,body,status_code,message,code,success):
    # 组织请求数据
        resp = loginapi.login(body)
        print(resp.json())
        asset(resp,status_code, message, code,success)